//1103.分糖果II
//https://leetcode.cn/problems/distribute-candies-to-people
class Solution {
public:
    vector<int> distributeCandies(int candies, int num_people) {
        vector<int> ret(num_people);

        for(int i = 1;candies>0;++i)
        {
            ret[(i-1)%num_people] += min(i,candies);
            candies-=i;
        }
        return ret;
    }
};